/*
 * @Date         : 2022-02-18 09:49:19
 * @LastEditors  : zu1662
 * @LastEditTime : 2022-03-04 09:15:00
 * @Description  : Store Main View
 * 
 * Copyright © 2022 by zu1662, All Rights Reserved. 
 */

// 如果页面需要对 Store 内数据做更新时触发渲染，组件需要被 observer 进行包裹。
// 参考：@/layout/components/Header

import { createContext, useContext } from 'react';
import RootStore from './rootStore';

const StoreContext = createContext(new RootStore());

// 设置 Store hook to use RootStore
export const useStore = () => useContext(StoreContext);

// 导出 provider
export const StoreProvider = StoreContext.Provider;
